
//Copyright 1997-2009 Syrinx Development, Inc.
//This file is part of the Syrinx Web Application Framework (SWAF).
// == BEGIN LICENSE ==
//
// Licensed under the terms of any of the following licenses at your
// choice:
//
//  - GNU General Public License Version 3 or later (the "GPL")
//    http://www.gnu.org/licenses/gpl.html
//
//  - GNU Lesser General Public License Version 3 or later (the "LGPL")
//    http://www.gnu.org/licenses/lgpl.html
//
//  - Mozilla Public License Version 1.1 or later (the "MPL")
//    http://www.mozilla.org/MPL/MPL-1.1.html
//
// == END LICENSE ==
using System;
using System.Collections;

namespace Swaf.Messaging
{
	/// <summary>
	/// Summary description for MessagingConnectionBase.
	/// </summary>
	public class MessagingConnectionBase : IMessagingConnection
	{
		protected IMessagingConnectionInfo m_info;

		public MessagingConnectionBase()
		{
			m_info = new QueueConnectionInfo();
		}

		public MessagingConnectionBase(string configId)
		{
			m_info = MessagingSystemBase.findConnectionInfo(configId);
		}

		public MessagingConnectionBase(IMessagingConnectionInfo info)
		{
			m_info = info;
		}


		#region IMessagingConnection Members

		public IMessagingConnectionInfo Config {get{return m_info;}}

		public virtual void clearAll()
		{
			throw new MessagingException("Not implemeneted");
		}

		public virtual long MessageCount
		{
			get
			{
				throw new MessagingException("Not implemeneted");
			}
		}

		public virtual IMessage receive(int timeoutInMS)
		{
			// TODO:  Add MessagingConnectionBase.receive implementation
			return null;
		}

		public virtual IMessage receive()
		{
			// TODO:  Add MessagingConnectionBase.Swaf.Messaging.IMessagingConnection.receive implementation
			return null;
		}

		public virtual bool send(string message, IDictionary msgProperties, string encryptName)
		{
			// TODO:  Add MessagingConnectionBase.send implementation
			return false;
		}

		public virtual bool send(string message, string encryptName)
		{
			// TODO:  Add MessagingConnectionBase.Swaf.Messaging.IMessagingConnection.send implementation
			return false;
		}

		public virtual bool send(string message, IDictionary msgProperties)
		{
			// TODO:  Add MessagingConnectionBase.Swaf.Messaging.IMessagingConnection.send implementation
			return false;
		}

		public virtual bool send(string message)
		{
			// TODO:  Add MessagingConnectionBase.Swaf.Messaging.IMessagingConnection.send implementation
			return false;
		}

		public virtual IEnumerable ReverseMessages
		{
			get
			{
				// TODO:  Add MessagingConnectionBase.ReverseMessages getter implementation
				return null;
			}
		}

		public virtual IEnumerable Messages
		{
			get
			{
				// TODO:  Add MessagingConnectionBase.Messages getter implementation
				return null;
			}
		}

		#endregion

		protected IMessagingSystem MsgSys
		{
			get
			{
				return MessagingSystemBase.getThreadSafeMessagingSystem(m_info.MessagingSystemId);
			}
		}
	}
}
